import React from 'react';

class AccColumns extends React.PureComponent {
	openFullWindowForXtable = () => {
		const { href } = this.props;
		window.openFullWindowForXtable(href);
	}
	onOperatesClick = () => {
		const { onOperatesClick, record, index } = this.props;
		if (typeof onOperatesClick === 'function') onOperatesClick(record, index, '', '2');
	}
  render() {
		const { record } = this.props;
		const { versionspan } = record;
		return (
			<span>
				<a className="titleA" onClick={this.openFullWindowForXtable} target="_blank">
					{record.imagefilenamespan}
				</a>
				{versionspan != 0 &&
				<span>
						(
					<span
						style={{ color: '#30B5FF', display: 'inline-block', verticalAlign: 'middle', cursor: 'pointer' }}
						onClick={this.onOperatesClick}
					>
							V{versionspan}
						</span>
						)
				</span>
				}
			</span>
		)
  }
}

export default AccColumns;
